Deduplicate validation results yield from validate.validate()#1619
Deduplicate validation results yield from validate.validate()#1619yarikoptic merged 1 commit intodandi:masterfrom
validate.validate()#1619Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1619 +/- ##
==========================================
+ Coverage 88.28% 88.43% +0.15%
==========================================
Files 78 78
Lines 11038 11045 +7
==========================================
+ Hits 9745 9768 +23
+ Misses 1293 1277 -16
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR addresses the issue of duplicate validation results from validate.validate() by introducing deduplication logic.
- Introduces df_results and df_result_ids to track unique ValidationResult objects.
- Updates the loop to yield only unique validation errors.
170fd43 to
1fb98b0
Compare
|
@yarikoptic Need to have this one approved quick. It is needed for #1599. |
|
"not sure", since this would just address the symptom, potentially hiding away some code inefficiency resulting in duplicate records. Did you look why we get duplicate records? |
There is some inefficiency but not terrible, and this inefficiency is not the result of a bug but somewhat by design. Let's look at the code without the changes in this PR. By NOT terrible inefficiency I mean that no repetitive validations have been done, and no duplicate Lines 171 to 176 in 4f466a8
When Lines 112 to 124 in 4f466a8 When Lines 167 to 172 in 4f466a8 Lines 96 to 104 in 4f466a8 There reason that there is no repetition in validation and creation of the same validation result objects is that all Line 142 in 4f466a8 BIDSDatasetDescriptionAsset._validate() actually only do validation once in its life time Lines 64 to 94 in 4f466a8 In sum, the repetition is only in the inclusions of the same |
|
🚀 PR was released in |
This PR closes #1617.
This solution is a bit awkward in my opinion, but it fixes the problem without overhaul of how validation is done in dandi-cli.